# debugtalk.py

import MySQLdb
import time
import re
import time

g_mobile ='188'

def getMobile():
    mobile = '188'+str(round(time.time() * 1000))[-9:-1]
    global g_mobile
    g_mobile = mobile
    print('g_mobile1'+g_mobile)
    return mobile
    time.sleep(2)
    

def getGmobile():
    print('g_mobile2'+g_mobile)
    return g_mobile

def getIdentifyCode():
    sqlxx = "select content from sms_message where mobile = '%s' order by create_time limit 1 "
    db = MySQLdb.connect(host='47.99.74.38',user='root',passwd='3Henniubi',db='qts_sms',charset='utf8')
    cursor = db.cursor()
    cursor.execute(sqlxx%g_mobile)
    res = cursor.fetchone()
    db.close()
    str1 = re.search('快速登录验证码：(.*)。请输入验证码完成登录。',res[0])
    return str1
